package edu.zjut.hjg.saas.biz.dao.impl;

import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;

import edu.zjut.hjg.saas.biz.dao.AdminDao;
import edu.zjut.hjg.saas.biz.model.Admin;

public class AdminDaoImpl extends SqlMapClientDaoSupport implements AdminDao {

    @Override
    public Admin findByUsername(String username) {
        return (Admin) getSqlMapClientTemplate().queryForObject("admin.findByUsername", username);
    }

    @Override
    public Admin load(Integer id) {
        return (Admin) getSqlMapClientTemplate().queryForObject("admin.load", id);
    }

    @Override
    public void update(Admin admin) {
        getSqlMapClientTemplate().update("admin.update", admin);
    }
}
